﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../css/quote2.css" rel="stylesheet" type="text/css" />
    <script> var isDebug = false</script>
    <script src="../lib//jquery.js" type="text/javascript"></script>
    <script src="../lib/migratory-jslib.js" type="text/javascript"></script>
    <!--[if IE]><script type="text/javascript" src="../lib/excanvas.min.js"></script><![endif]-->
    <script src="../js/mstar.common.js" type="text/javascript"></script>
    <script src="../js/DFmt.us.js" type="text/javascript"></script>
    <!--<script src="../lib/mstar.rtq.chart_min.js" type="text/javascript"></script>-->


    <script src="../lib/mstar.flot.js" type="text/javascript"></script>
    <script src="../js/util.js" type="text/javascript"></script>
    <script src="../js/DBHelper.js" type="text/javascript"></script>
    <script src="../js/dragdrop.js" type="text/javascript"></script>
    <script src="../js/QuoteData.js" type="text/javascript"></script>

    <style>
    body{ margin:0; padding:0}ul,li {padding:0; margin:0}
    </style>
</head>
<body>
<div id="chart1" style="position:relative"></div>
<div class="rtq-window-setpn rtq-window-setpn-cht" style="display: block; top: 0px; left: 783px; z-index: 9117;visibility: visible;">
         <div class="wrap">
            <h4>
                Chart Options</h4>
            <div class="ctn" id="chartSetting"></div>
        </div>
        <div class="rtq-window-setpn-ft">
            <div class="ft-inner">
            </div>
        </div>
    </div>
  <div style="width:100%;">
    <p>Symbol:<input type="text" id="s" value=""/>(such as:XNAS:MSFT)</p>
    <p>change Main Ticker<input type=button onclick="changeMainTicker()" value="change main Ticker"/> don't change the chart state</p>
    </div>
      <div style="width:100%;">
     <p>recur state of chart:<input type=button onclick="initChart()" value="redraw chart"/></p>
    </div>
<script>
var reloginUrl = "http://rtqdev.morningstar.com/opt/logout.jsp";    // when session expired or can't login redirect this page.
var intradayUrl  = "http://rtqdev.morningstar.com/opt/quote.jsp?"; // get intrayData Url.
if (Cookies.get("SessionID") == null) {
    window.location.href = reloginUrl;
}
var debug = true;  /// it will get data api in dev server.
var culture = "en-US";
var region = "USA";
var config1 = { width: 765, height: 456 };
var mainTicker = "XNYS:IBM";
var ch1 = new RTChartComponent(mainTicker, region, culture );
ch1.setLoginUrl(reloginUrl);
ch1.setIntrayDataUrl(intradayUrl);
var setting = document.getElementById("chartSetting");
ch1.initUIConfig({RightMenu:true,Chart:{showPChart:true,showVChart:true,showLegend:true,showTimeSlider:true},chartCtrl:"rtqPanel",settingPanel:setting});
ch1.Init("chart1", "ch1",config1);
function changeMainTicker() {
    var ticker = document.getElementById("s").value;
    if(ticker != "") {
        if(ch1 != null) {
            mainTicker = ticker;
            ch1.acceptTicker(ticker);
        }
    }
}

function initChart() {
    if(ch1 != null ) {
        ch1.clearUp();
    }
    ch1 = new RTChartComponent(mainTicker, region, culture );
    ch1.setLoginUrl(reloginUrl);
    ch1.setIntrayDataUrl(intradayUrl);
    conf  = ch1.Init("chart1", "ch1",config1);
}
</script>
</body>
</html>

